package com.kaluli.project.utils;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.apache.commons.lang.StringUtils;
import org.dom4j.Document;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class TestFile {

	public static void main(String[] args) throws IOException {
		/*String content = "<?xml version=?><ResponseMessage> <SenderID>IE160125658534</SenderID><MessageType>880020</MessageType>"+"<?xml version=?><ResponseMessage> <SenderID>IE160125658534</SenderID><MessageType>880020</MessageType>"+"<?xml version=?><ResponseMessage> <SenderID>IE160125658534</SenderID><MessageType>880020</MessageType>"+"<?xml version=?><ResponseMessage> <SenderID>IE160125658534</SenderID><MessageType>880020</MessageType>"+"<?xml version=?><ResponseMessage> <SenderID>IE160125658534</SenderID><MessageType>880020</MessageType>";
		String local = "d:\\data\\xml";
		InputStream is = new ByteArrayInputStream(content.getBytes("UTF-8"));
		
		File localFile = new File(local + "\\hg\\test.txt");
		localFile.createNewFile();
		OutputStream out = new FileOutputStream(localFile);
//		ftpClient.retrieveFile(file.getName(), out);
        byte[] buffer = new byte[1024];  
        int i = -1;  
        while ((i = is.read(buffer)) != -1) {
        	out.write(buffer, 0, i);  
        }*/
		String json = "{\"orderId\":\"null\",\"status\":2,\"notes\":\"延后处理：[custjson.addOrder] 等待处理任务超过10个，延后推送！\"}";
		JSONObject responseObj = JSON.parseObject(json);
		String orderId = responseObj.getString("orderId");
		if(StringUtils.isNotBlank(orderId) && !orderId.equals("null")){
//			kllOrderSynApiRepository.updateSynStatus(order_number, "ZZ_status");
			System.out.println("11");
		}else{
			System.out.println(22);
		}
	}
}
